	<?php $this->load->view('admin/partials/buyer_menu'); ?>
	<?php $ci = &get_instance();?>
	<?php 
		$buyerAccountType = buyerAccountTypeDataConfig();
	?>
	<h3>Buyers &raquo; <?php echo ucfirst($this->uri->segment(4,''));?></h3>
	<?php $buttons = array('buttons'=>array('add#buyer_add();') );?>
	<?php $this->load->view('admin/partials/buttons', $buttons ); ?>
	
	<div class="clrboth"></div>
	
	<?php $this->load->view('admin/buyer/search_partial' ); ?>
	<div class="clrboth"></div>
	
	<table border="0" class="table-list">
		<thead>
			<tr>
				<th>Account code</th>
				<th>Account Type</th>
				<th>Name</th>
				<th>Email</th>
				<th>All bids</th>
				<th>Created date</th>
				<th>Status</th>
				<th><?php echo lang('dataman.manage'); ?></th>
			</tr>
		</thead>
		
		<tbody>
			<?php foreach( $items['items'] as $item ): ?>
			<?php 
				$USER = $ci->user_entity->init('id',$item->id);
				$userStatus = userStatusDataConfig();
			?>
			<tr>
				<td><a href="javascript:void(0);" onclick="_openDialogInfo(<?php echo $item->id;?>)"><?php echo $USER->getAccCode(); ?></a></td>
				<td><?php if($USER->getBuyerType()) echo $buyerAccountType[$USER->getBuyerType()];?></td>
				<td><?php echo $USER->getFirstName()." ".$USER->getLastName(); ?></td>
				<td><?php echo $USER->getEmail(); ?></td>
				<td><a href="<?php echo site_url('admin/dataman/bid/search?key='.$USER->getAccCode().'&filter=buyer_acc_code')?>" >View</a></td>
				<td><?php echo sbxDateFormat($USER->getCreatedDate()); ?></td>
				<td><?php echo $userStatus[$USER->getStatus()];?></td>
				<td>
				<?php if($USER->getStatus() == 'active'):?>
					<a href="javascript:void(0);" onclick="_deactive(<?php echo $item->id;?>)"><?php echo lang('dataman.deactivate');?></a>
				<?php else:?>
					<a href="javascript:void(0);" onclick="_active(<?php echo $item->id;?>)"><?php echo lang('dataman.activate');?></a>
				<?php endif;?>
					&nbsp;|&nbsp;
					<a href="javascript:void(0);" onclick="_edit(<?php echo $item->id;?>)"><?php echo lang('dataman.edit');?></a>
					&nbsp;|&nbsp;
					<a href="javascript:void(0);" onclick="_delete(<?php echo $item->id;?>)" class="confirm"><?php echo lang('dataman.delete');?></a>
				</td>
			</tr>
			<?php endforeach; ?>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="6">
					<div class="inner"><?php echo $items['pagination']['links']; ?></div>
				</td>
			</tr>
		</tfoot>
	</table>


